
# may produce AttributeError for non-songs
def songrepr(song):
    try:
        return "%s - %s" % (song.artist, song.title)
    except AttributeError:
        return song.file

def issong(s):
    try:
        songrepr(s)
        return True
    except AttributeError:
        return False
